/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package thinkbread;

import java.util.Date;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

/**
 *
 * @author zzn
 */
public class WhereRUMIDlet extends MIDlet implements CommandListener{
    private Display display;
    private final static Command CMD_EXIT = new Command("Exit", Command.EXIT, 1);
    private final static Command CMD_BACK = new Command("Back", Command.BACK, 1);
    public WhereRUMIDlet(){
        this.display = Display.getDisplay(this);
    }
    protected void destroyApp(boolean arg0){
        
    }

    protected void startApp(){
        double i;
        Date d= new Date();
        MapCanvas mapCanvas = new MapCanvas();
        mapCanvas.repaint(10, 1, mapCanvas.getWidth()-20, mapCanvas.getHeight()-20);
        mapCanvas.setCommandListener(this);
        mapCanvas.addCommand(CMD_EXIT);
        this.display.setCurrent(mapCanvas);
        
    }

    protected void pauseApp() {
        
    }

    public void commandAction(Command c, Displayable d) {
        if(c== CMD_EXIT){
            destroyApp(false);
            notifyDestroyed();
        }else if(c==CMD_BACK){
            //display.setCurrent(this);
        }
    }

}
